require 'json'
require 'rss'
def j2r jsonfile
js = JSON.load(open(jsonfile))

rss = RSS::Maker.make("2.0") do |maker|
  maker.channel.about = "http://example.com/index.rdf"
  maker.channel.title = "zxdh"
  maker.channel.description = "Example Site"
  maker.channel.link = "http://example.com/"

	js['items'].each{|item|
		maker.items.new_item do |rssitem|
			rssitem.title = item['title']
			rssitem.description = item['summary']['content']
			rssitem.author = item['author']
			rssitem.link = item['alternate'][0]['href']
			#rssitem.Guid = item['id']
		end
	}
end

oo = open 'youkugoogle.rss',"w"
oo.print rss.to_s
oo.close
js['items'].length
end